package com.app.base.utils;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;


/**
 * Created by ZZH on 2015/11/23.
 */
public class LosNetWork {

    public static boolean haveAvailableNetwork(Context context) {
        ConnectivityManager ctm = (ConnectivityManager) context.getSystemService(
                Context.CONNECTIVITY_SERVICE);
        NetworkInfo activeNetInfo = ctm.getActiveNetworkInfo();
        if (activeNetInfo != null && activeNetInfo.isAvailable()) {
            return true;
        }
        return false;
    }
}